package com.zhangsun.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhangsun.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 * 部门
 * </p>
 *
 * @author zhangsun
 * @since 2019-08-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("system_department")
public class DepartmentEntity extends BaseEntity<DepartmentEntity> {

    /**
     * 部门名
     */
    private String name;

    /**
     * 上级id
     */
    private String parentId;

    /**
     * 子部门
     */
    @TableField(exist = false)
    private List<DepartmentEntity> children;

    /**
     * 上级id集合
     */
    @TableField(exist = false)
    private List<String> parentIds;


}
